package com.huawei.crm.sample.infrastructure.outbound.persistence.order.converter;

import com.huawei.crm.sample.domain.order.model.aggragate.Order;
import com.huawei.crm.sample.domain.order.model.entity.OrderItem;
import com.huawei.crm.sample.infrastructure.outbound.persistence.order.po.OrderItemPO;
import com.huawei.crm.sample.infrastructure.outbound.persistence.order.po.OrderPO;
import org.mapstruct.Mapper;

import java.util.List;

@Mapper(componentModel = "spring")
public interface OrderPOConverter {

    OrderPO toPO(Order order);
    Order toDomain(OrderPO po);

    OrderItemPO toItemPO(OrderItem item);
    OrderItem toItem(OrderItemPO po);

    List<OrderItemPO> toItemPOList(List<OrderItem> items);
    List<OrderItem> toItemList(List<OrderItemPO> pos);
} 